//
//  struct.cpp
//  learnC++
//
//  Created by apple on 2018/5/24.
//  Copyright © 2018年 yunfan.com. All rights reserved.
//

#include "struct.hpp"


static int getSomthing(){
    
    printf("PPPPPP\n");
    
    PStudentinfo p1 = (Studentinfo *)malloc(sizeof(Studentinfo));
    Studentinfo *p2 = (Studentinfo *)malloc(sizeof(Studentinfo));
    return 1;
}

void test_struct(){
    Employee member{1,23,12.1,getSomthing};//c++ 11 style
    Employee frank { 2, 28 }; // frank.id = 2, frank.age = 28, frank.wage = 0.0 (default initialization)
    
    Employee staff = {1,22,13.3};//c style
    
    Company myCom{{1},30};
    
    staff = {0,0,0,0};
    
    printf("%d=%d=%lu==%lu\n",member.id,member.age,sizeof(double),sizeof(Employee));
    
    
    member.member();
    
}
